package top.chukongxiang.monitorservice.model.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import top.chukongxiang.monitorservice.model.constant.ValidationGroups;
import top.chukongxiang.monitorservice.model.enums.SdkLoginMode;

/**
 * @author 楚孔响
 * @version 1.0
 * @date 2023/10/25 09:28
 */
@Data
@TableName("server_config")
public class ServerConfig {

    @TableId
    private Long id;

    /**
     * 设备名称
     */
    private String name;

    /**
     * 设备ip
     */
    @NotBlank(groups = ValidationGroups.SdkLogin.class)
    private String ip;

    /**
     * 设备端口
     */
    @NotNull(groups = ValidationGroups.SdkLogin.class)
    @Min(value = 0, groups = ValidationGroups.SdkLogin.class)
    @Max(value = 65535, groups = ValidationGroups.SdkLogin.class)
    private Integer port;

    /**
     * 设备用户名
     */
    @NotBlank(groups = ValidationGroups.SdkLogin.class)
    private String username;

    /**
     * 设备密码
     */
    @NotBlank(groups = ValidationGroups.SdkLogin.class)
    private String password;

    /**
     * 登录方式
     */
    @NotNull(groups = ValidationGroups.SdkLogin.class)
    private SdkLoginMode loginMode;

}
